// 用户相关接口
import request from '@/utils/request'
import { loginForm, loginResponseData, getInfoResponseData } from './type'

enum API {
  LOGIN_URL = 'user/login', //登录
  USERINFO_URL = 'user/info', //用户信息
}

//暴露函数
//登录
export const ApiLogin = (data: loginForm) => {
  return request.post<any, loginResponseData>(API.LOGIN_URL, data)
}

//获取用户信息
export const ApiUserInfo = () => {
  return request.get<any, getInfoResponseData>(API.USERINFO_URL)
}
